package application

import (
	"ruoyi/domain/entity/common"
	"ruoyi/domain/entity/response"
	"ruoyi/domain/entity/system"
	"ruoyi/domain/repository"
)

type DeptApp struct {
	dept repository.SysDeptRepository
}

var _ DeptAppInterface = &DeptApp{}

type DeptAppInterface interface {
	GetDeptInfo(deptId string) system.SysDept
	GetDeptList(params common.SearchTableDataParam, isPaging bool) ([]system.SysDeptResult, int64)

	SaveDept(sysDept system.SysDept) response.Response

	UpDataDept(sysDept system.SysDept) response.Response

	DeleteDept(deptId string) response.Response

	SelectDeptTreeList() []system.TreeSelect

	GetChildList(deptS []system.SysDept, deptId int) []system.TreeSelect
}

func (d *DeptApp) GetDeptInfo(deptId string) system.SysDept {
	return d.dept.GetDeptInfo(deptId)
}

func (d *DeptApp) GetDeptList(params common.SearchTableDataParam, isPaging bool) ([]system.SysDeptResult, int64) {
	return d.dept.GetDeptList(params, isPaging)
}

func (d *DeptApp) SaveDept(sysDept system.SysDept) response.Response {
	return d.dept.SaveDept(sysDept)
}

func (d *DeptApp) UpDataDept(sysDept system.SysDept) response.Response {
	return d.dept.UpDataDept(sysDept)
}

func (d *DeptApp) DeleteDept(deptId string) response.Response {
	return d.dept.DeleteDept(deptId)
}

func (d *DeptApp) SelectDeptTreeList() []system.TreeSelect {
	return d.dept.SelectDeptTreeList()
}

func (d *DeptApp) GetChildList(deptS []system.SysDept, deptId int) []system.TreeSelect {
	return d.dept.GetChildList(deptS, deptId)
}
